home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -serious- / programming / c / stringlib / doku / stringlib.readme.orig < prev   
Text File  |  1999-12-06  |  4KB  |  89 lines

  1. POSTER:
  2. =======
  3. Article 235 of mod.sources:
  4. Relay-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site unisoft.UUCP
  5. Path: unisoft!lll-lcc!vecpyr!amd!amdcad!decwrl!decvax!genrad!mit-eddie!mirror!sources-request
  6. From: sources-request@mirror.UUCP
  7. Newsgroups: mod.sources
  8. Subject: v06i043:  X3J11/SVID/4BSD/etc string library (stringlib)
  9. Message-ID: <125@mirror.UUCP>
  10. Date: 8 Jul 86 21:35:35 GMT
  11. Date-Received: 9 Jul 86 14:14:59 GMT
  12. Sender: rs@mirror.UUCP
  13. Lines: 1515
  14. Approved: rs@mirror.UUCP
  15.  
  16. Submitted by: ihnp4!utzoo!henry (Henry Spencer)
  17. Mod.sources: Volume 6, Issue 43
  18. Archive-name: stringlib
  19.  
  20. [  This is an update of the string library Henry posted to net.sources
  21.    some time ago.  It is different from a recent library published in
  22.    volume 4 in these two respects:
  23.     1. It comes with a fairly exhaustive test program, which it passes.
  24.     2. It does not invent new functions; it implements the union of those
  25.        described in X3J11, the SVID, etc., and nothing else.
  26.    It would be nice if everyone -- vendors, users -- put the "missing"
  27.    functions into their C library, and we could all live in harmony,
  28.    but I suspect that's wishful thinking.  (Yeah, yeah:  efficiency, too.)
  29.    This is also excempted from my mandatory manpage requirement, for
  30.    reasons mentioned and alluded to in the second paragraph of the README
  31.    file.  --r$ ]
  32.  
  33.  
  34. readme:
  35. -------
  36. This is a public-domain reimplementation of string(3) and friends, notably
  37. memory(3) and bstring(3) (except ffs).  Not derived from licensed software.
  38. This code may be used on any computer system for any purpose by anyone.
  39.  
  40. Relative to my old net.sources posting, this one adds some functions and
  41. fixes one or two obscure bugs.  There has been another string library
  42. posted in recent times, with many more functions; I haven't inspected it
  43. and can't comment on its relationship to mine.  Alas, the manual pages
  44. for this stuff are copyright by various people other than me, so I can't
  45. include them.  See your local Unix manuals.
  46.  
  47. This distribution implements precisely the union of the string functions
  48. of the SVID, 4BSD, X3J11, and V7.  Included is a large test program that
  49. exercises everything quite thoroughly.  (Note that some existing libraries,
  50. including e.g. V7, flunk one or more of these tests.)
  51.  
  52. In the event of conflict between the definitions from various places, the
  53. newer or more portable one is chosen.  That is, X3J11 overrules the SVID,
  54. which in turn overrules older Unixes.
  55.  
  56. The code is written for maximal portability.  Some efficiency has been
  57. sacrificed in the cause of meticulously avoiding possible portability
  58. problems.  For example, this code never assumes that a pointer can be
  59. moved past the end of an array and then backed up.  Many of these functions
  60. can be implemented more efficiently if machine-dependent assumptions are
  61. made; memcpy is a particular glaring case.
  62.  
  63. Simplistically:  put this stuff into a source directory, inspect Makefile
  64. for compilation options that need changing to suit your local environment,
  65. and then do "make r".  This compiles the functions and the test program and
  66. runs the tests.  If there are no complaints, put string.h in /usr/include
  67. (you may also want to "make memory.h" and put it in /usr/include) and add
  68. the functions (*.o except for tester.o) to your C library.  The internal
  69. interdependencies are:
  70.  
  71.     index    needs    strchr
  72.     rindex    needs    strrchr
  73.     bcopy    needs    memcpy
  74.     bcmp    needs    memcmp
  75.     bzero    needs    memset
  76.  
  77. I haven't included an implementation of Berkeley's ffs function partly
  78. because it's not trivial to do in a portable way, and partly because I
  79. don't really see it as a string function.
  80.  
  81. A weakness in the tester program is that it uses quite short strings for
  82. everything, and pays no real attention to alignment issues.  Optimized
  83. implementations of things like memcpy would need a more elaborate set of
  84. test cases to put them through their full paces.
  85.  
  86.                 Henry Spencer @ U of Toronto Zoology
  87.                 {allegra,ihnp4,decvax,pyramid}!utzoo!henry
  88.                 Wed Jun 25 19:21:34 EDT 1986
  89.